Integrand size = 10, antiderivative size = 67 \[ \int x \cos (2 x) \sec ^3(x) \, dx=-3 i x \arctan \left (e^{i x}\right )+\frac {3}{2} i \operatorname {PolyLog}\left (2,-i e^{i x}\right )-\frac {3}{2} i \operatorname {PolyLog}\left (2,i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x) \]
[Out]
Time = 0.16 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 19, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {4516, 4266, 2317, 2438, 4498, 4270} \[ \int x \cos (2 x) \sec ^3(x) \, dx=-3 i x \arctan \left (e^{i x}\right )+\frac {3}{2} i \operatorname {PolyLog}\left (2,-i e^{i x}\right )-\frac {3}{2} i \operatorname {PolyLog}\left (2,i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \tan (x) \sec (x) \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 4266
Rule 4270
Rule 4498
Rule 4516
Rubi steps \begin{align*} \text {integral}& = \int \left (x \sec (x)-x \sec (x) \tan ^2(x)\right ) \, dx \\ & = \int x \sec (x) \, dx-\int x \sec (x) \tan ^2(x) \, dx \\ & = -2 i x \arctan \left (e^{i x}\right )-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx+\int x \sec (x) \, dx-\int x \sec ^3(x) \, dx \\ & = -4 i x \arctan \left (e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)+i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )-\frac {1}{2} \int x \sec (x) \, dx-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx \\ & = -3 i x \arctan \left (e^{i x}\right )+i \operatorname {PolyLog}\left (2,-i e^{i x}\right )-i \operatorname {PolyLog}\left (2,i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)+i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right )+\frac {1}{2} \int \log \left (1-i e^{i x}\right ) \, dx-\frac {1}{2} \int \log \left (1+i e^{i x}\right ) \, dx \\ & = -3 i x \arctan \left (e^{i x}\right )+2 i \operatorname {PolyLog}\left (2,-i e^{i x}\right )-2 i \operatorname {PolyLog}\left (2,i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x)-\frac {1}{2} i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )+\frac {1}{2} i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right ) \\ & = -3 i x \arctan \left (e^{i x}\right )+\frac {3}{2} i \operatorname {PolyLog}\left (2,-i e^{i x}\right )-\frac {3}{2} i \operatorname {PolyLog}\left (2,i e^{i x}\right )+\frac {\sec (x)}{2}-\frac {1}{2} x \sec (x) \tan (x) \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(146\) vs. \(2(67)=134\).
Time = 0.23 (sec) , antiderivative size = 146, normalized size of antiderivative = 2.18 \[ \int x \cos (2 x) \sec ^3(x) \, dx=\frac {1}{4} \left (6 x \log \left (1-i e^{i x}\right )-6 x \log \left (1+i e^{i x}\right )+6 i \operatorname {PolyLog}\left (2,-i e^{i x}\right )-6 i \operatorname {PolyLog}\left (2,i e^{i x}\right )+\frac {2 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}+\frac {x}{\left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )^2}-\frac {2 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}+\frac {x}{-1+\sin (x)}\right ) \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 101 vs. \(2 (48 ) = 96\).
Time = 9.37 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.52
method | result | size |
risch | \(\frac {i {\mathrm e}^{i x} \left ({\mathrm e}^{2 i x} x -x -i {\mathrm e}^{2 i x}-i\right )}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}-\frac {3 x \ln \left (1+i {\mathrm e}^{i x}\right )}{2}+\frac {3 x \ln \left (1-i {\mathrm e}^{i x}\right )}{2}+\frac {3 i \operatorname {dilog}\left (1+i {\mathrm e}^{i x}\right )}{2}-\frac {3 i \operatorname {dilog}\left (1-i {\mathrm e}^{i x}\right )}{2}\) | \(102\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 144 vs. \(2 (38) = 76\).
Time = 0.25 (sec) , antiderivative size = 144, normalized size of antiderivative = 2.15 \[ \int x \cos (2 x) \sec ^3(x) \, dx=\frac {3 \, x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) - 3 \, x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) + 3 \, x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) - 3 \, x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) - 3 i \, \cos \left (x\right )^{2} {\rm Li}_2\left (i \, \cos \left (x\right ) + \sin \left (x\right )\right ) - 3 i \, \cos \left (x\right )^{2} {\rm Li}_2\left (i \, \cos \left (x\right ) - \sin \left (x\right )\right ) + 3 i \, \cos \left (x\right )^{2} {\rm Li}_2\left (-i \, \cos \left (x\right ) + \sin \left (x\right )\right ) + 3 i \, \cos \left (x\right )^{2} {\rm Li}_2\left (-i \, \cos \left (x\right ) - \sin \left (x\right )\right ) - 2 \, x \sin \left (x\right ) + 2 \, \cos \left (x\right )}{4 \, \cos \left (x\right )^{2}} \]
[In]
[Out]
\[ \int x \cos (2 x) \sec ^3(x) \, dx=\int x \cos {\left (2 x \right )} \sec ^{3}{\left (x \right )}\, dx \]
[In]
[Out]
\[ \int x \cos (2 x) \sec ^3(x) \, dx=\int { x \cos \left (2 \, x\right ) \sec \left (x\right )^{3} \,d x } \]
[In]
[Out]
\[ \int x \cos (2 x) \sec ^3(x) \, dx=\int { x \cos \left (2 \, x\right ) \sec \left (x\right )^{3} \,d x } \]
[In]
[Out]
Time = 27.65 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.94 \[ \int x \cos (2 x) \sec ^3(x) \, dx=\frac {1}{2\,\cos \left (x\right )}+x\,\mathrm {atanh}\left ({\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )-\frac {x\,\sin \left (x\right )}{2\,{\cos \left (x\right )}^2}+\frac {\mathrm {polylog}\left (2,-{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}-\frac {\mathrm {polylog}\left (2,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}-x\,\mathrm {atan}\left ({\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,4{}\mathrm {i} \]
[In]
[Out]